{{template "member/top.html" .}}
<div class="m-b-md"> <h3 class="m-b-none">{{msg $ "pagingAndSort"}}</h3></div>

<div class="row">
<div class="col-sm-8">
	<div id="formData">
		<section class="panel panel-default">
			<div class="panel-body">
  				<div class="alert alert-danger" id="domainMsg" style="display: none"></div>
  				
				<form  role="form" id="dataFrom">
					<div class="form-group">
						<label for="perPageSize">{{msg . "perPageSize"}}</label>
						  <input type="text" class="form-control"
								placeholder="10"
								id="perPageSize"
								name="perPageSize"
								value="{{.userBlog.PerPageSize}}" />
					</div>
					<div class="form-group">
						<label for="perPageSize" >{{msg . "sortField"}}</label>
						  <select class="form-control"
							id="sortField"
							name="sortField"
							value="">
							<option value="PublicTime" {{if eq $.userBlog.SortField "PublicTime"}}selected{{end}}>{{msg $ "publicTime"}}</option>
							<option value="CreatedTime" {{if eq $.userBlog.SortField "CreatedTime"}}selected{{end}}>{{msg $ "createdTime"}}</option>
							<option value="UpdatedTime" {{if eq $.userBlog.SortField "UpdatedTime"}}selected{{end}}>{{msg $ "updatedTime"}}</option>
							<option value="Title" {{if eq $.userBlog.SortField "Title"}}selected{{end}}>{{msg . "title"}}</option>
						  </select>
					</div>
					<div class="form-group">
						<label>{{msg $ "sortType"}}</label>
						<div>
						<label><input type="radio" name="isAsc" value="0" {{if not .userBlog.IsAsc}}checked{{end}}> {{msg . "desc"}}</label>
						<label><input type="radio" name="isAsc" value="1" {{if .userBlog.IsAsc}}checked{{end}}> {{msg . "asc"}}</label>
						</div>
					</div>
				</form>
			</div>
			<footer class="panel-footer text-right bg-light lter">
			    <button type="submit" id="baseBtn" class="btn btn-success">{{msg . "submit"}}</button>
			</footer>
		</section>
	</div>
</div>

</div>
{{template "member/footer.html" .}}
<script>
var urlPrefix = "{{.siteUrl}}";
$(function() {
	// domain
	$("#baseBtn").click(function(e) {
		e.preventDefault();
		var data = $("#dataFrom").serialize();
		post("/member/blog/setUserBlogPaging", data, function(re) {
			if(re.Ok) {
				showAlert("#domainMsg", "{{msg . "saveSuccess"}}", "success");
			} else {
				showAlert("#domainMsg", re.Msg, "danger");
			}
		}, this);
	});
});
</script>

{{template "member/end.html" .}}
